
#include<iostream>

#include"SeqList.h"
#include "SeqList.cpp"

using namespace std;
int main() {
    int m = 6, n = 8;
    int a[] = { 2,3,4,5,8,10 }, b[] = { 1,3,4,7,8,9,11,12 };
    SeqList<int> A(a, m), B(b, n), C(m + n);
    int i = 0, j = 0;
    while (i < m && j < n) {
        if (a[i] <= b[j]) {
            C.Add(a[i]);
            i++;
        }
        else {
            C.Add(b[j]);
            j++;
        }
    }

    for (; i < m; i++) {
        C.Add(a[i]);
    }
    for (; j < n; j++) {
        C.Add(b[j]);
    }

    for (int k = 0; k < m + n; k++) {
        cout << C[k] << " ";
    }
}
